home *** CD-ROM | disk | FTP | other *** search
Text File | 1985-05-31 | 968 b | 55 lines | [TEXT/TRUE] |
- ! Library of trigonometric functions (degrees)
- ! Copyright (c) 1985 by True BASIC, Inc.
-
- EXTERNAL
-
- DEF cot(x)
- OPTION ANGLE degrees
- LET cot = 1/tan(x)
- END DEF
-
- DEF sec(x)
- OPTION ANGLE degrees
- LET sec = 1/cos(x)
- END DEF
-
- DEF csc(x)
- OPTION ANGLE degrees
- LET csc = 1/sin(x)
- END DEF
-
- DEF asin(x)
- OPTION ANGLE degrees
- IF abs(x)<1 then
- LET asin = atn(x/sqr(1-x*x))
- ELSEIF x=1 then
- LET asin = 90
- ELSEIF x=-1 then
- LET asin = -90
- ELSE
- CAUSE EXCEPTION -3000, "Argument not in range"
- END IF
- END DEF
-
- DEF acos(x)
- DECLARE DEF asin
- LET acos = 90 - asin(x)
- END DEF
-
- DEF acot(x)
- OPTION ANGLE degrees
- LET acot = 90 - atn(x)
- END DEF
-
- DEF asec(x)
- DECLARE DEF acos
- IF x=0 then CAUSE EXCEPTION -3000, "Argument not in range"
- LET asec = acos(1/x)
- END DEF
-
- DEF acsc(x)
- DECLARE DEF asin
- IF x=0 then CAUSE EXCEPTION -3000, "Argument not in range"
- LET acsc = asin(1/x)
- END DEF
-